﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace Medianamik.UI.Blog.Logic
{
    public abstract class UserBaseUserControl : BaseUserControl
    {
        #region " MEMBERS "
            public bool IsInEditionMode { get; protected set; }
        #endregion

        #region " EVENTS "
        public delegate void BeforeSave(MembershipUser sender, SaveUserEventArgs e);
            public event BeforeSave OnBeforeSave;

            public delegate void Saved(MembershipUser sender);
            public event Saved OnSaved;
        #endregion

        #region " METHODS "

            public abstract void Save();

            protected void RaiseOnSaved(MembershipUser sender)
            {
                if (OnSaved != null)
                    OnSaved(sender);
            }

            protected void RaiseOnBeforeSave(MembershipUser sender, SaveUserEventArgs e)
            {
                if (OnBeforeSave != null)
                    OnBeforeSave(sender, e);
            }

        #endregion
    }
}
